/*
 * J.I.M, the JXTA Instant Messenger
 * Copyright (C) 2003 University of Hamburg, Germany
 * 
 * This is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * The authors can be contacted as follows:
 * email:          baier@informatik.uni-hamburg.de
 * web:            http://vsis-www.informatik.uni-hamburg.de/jim
 * postal address: Uni Hamburg - FB Informatik - VSIS
 *                 Vogt-K�lln-Stra�e 30
 *                 22527 Hamburg
 *                 GERMANY
 */

package cu.ds.logicalsync.fytasrealm.communication;

/**
 * An exception during communication throughout the application
 * 
 * @see JxtaConnection
 *
 * @author r.vashira
 */
public class CommunicationException extends Exception{
	
	private Exception targetException = null;
	
	/**
	 * Create a new instance of this Exception.
	 *
	 * @see java.lang.Throwable#Throwable(String)
	 */
	public CommunicationException(String message) {
		super(message);
	}
	/**
	 * Constructor which gets a message text and a target exception.
	 *
	 * @param paramMessage the message text
	 * @param paramTargetException the target exception
	 */
	public CommunicationException(String paramMessage, Exception paramTargetException) {
		super(paramMessage);
		setTargetException(paramTargetException);
	} 

	/**
	 * Returns the targetException.
	 *
	 * @return Exception, based on this exception or <code>null</code>.
	 */
	public Exception getTargetException() {
		return targetException;
	}

	/**
	 * Sets the targetException.
	 * @param targetException The targetException to set
	 */
	public void setTargetException(Exception targetException) {
		this.targetException = targetException;
	}

}
